package com.atguigu.day01;

/**
 * 面试题
 *
 * @author sx
 * @date 2022-02-24 16:28
 */
public class Demo10 {
    public static void main(String[] args) {
        StringBuffer a = new StringBuffer("A");
        StringBuffer b = new StringBuffer("B");
        switchStr(a, b);
        System.out.println(a + "," + b);    //AB,B
    }

    public static void switchStr(StringBuffer x, StringBuffer y) {
        x.append(y);
        System.out.println(x);  //AB
        y = x;
        System.out.println(y);  //AB
    }
}

